package org.example.JVM.ByteCode.Type;

import lombok.Data;

/**
 * @description:Code属性，包含了方法指向的字节码指令以及相关辅助信息
 * @author: farprt
 * @create: 2022-11-15 19:22
 **/
@Data
public class Code_attribute {

    private U2 attribute_name_index;
    private U4 attribute_length;
    private U2 max_stack;// 操作数栈大小
    private U2 max_locals;// 局部变量表大小
    private U4 code_length;
    private byte[] code;
    private U4 exception_table_length;
    private Exception[] exception_table;// 存储try-catch信息的异常表
    private U2 attributes_count;
    private AttributeInfo[] attributes;// Code属性表

    public static class Exception{
        private U2 start_pc;
        private U2 end_pc;
        private U2 handler_pc;
        private U2 catch_type;
    }

}